<%@page import="java.util.List"%>
<%@page import="com.jfinal.plugin.activerecord.Page"%>
<%@page import="com.hongye.app.model.MenuModel"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" isELIgnored="false"
    pageEncoding="UTF-8"%>
<%  MenuModel menudetail=(MenuModel)request.getAttribute("menudetail"); %>
<!doctype html>
<html class="fixed">
	<head>
		<!-- Basic -->
		<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="keywords" content="HTML5 Admin Template" />
		<meta name="description" content="Porto Admin - Responsive HTML5 Template">
		<meta name="author" content="okler.net">
		<!-- Mobile Metas -->
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<!-- Vendor CSS -->
		<link rel="stylesheet" href="../admin/css/bootstrap.css" />
		<link rel="stylesheet" href="../admin/css/font-awesome/css/font-awesome.css" />
        <link rel="stylesheet" href="../admin/css/select2.css" />
		<!-- Theme CSS -->
		<link rel="stylesheet" href="../admin/css/theme.css" />
		<!-- Skin CSS -->
		<link rel="stylesheet" href="../admin/css/default.css" />
		<!-- Theme Custom CSS -->
		<!-- Theme Custom ../admin/css -->
		<script src="../admin/js/modernizr.js"></script>
	</head>
	<body >
		<section role="main" class="content-body" style="margin-top: 50px;">
			<!-- start: page -->
			<section class="panel">
				<header class="panel-heading">
					<h2 class="panel-title">菜单修改-详情</h2>
				</header>
				<div class="panel-body">
					<div class="panel-body">
						<p class="lead"> <span class="alternative-font"><%=menudetail.get("menu_name") %></span> </p>
						菜单名：<input id="menuname" type="text" name="menuname" value="<%=menudetail.get("menu_name") %>" />
						菜单父节点：<input id="pid" type="text" name="pid" value="<%=menudetail.get("pid") %>" />
						菜单URL：<input id="url" type="text" name="url" value="<%=menudetail.get("menu_url") %>" />
						<a  class="btn btn-facebook mb-md ml-xs mr-xs" onclick="editmenu();" >提交修改 </a>
             		 	<a  href="../admin/menuView" class="btn btn-facebook mb-md ml-xs mr-xs" onclick="addmenuhid();">取消</a>
					</div>
				</div>
			</section>
		<!-- Specific Page Vendor -->
		<!-- Vendor -->
		<script src="../admin/js/jquery.js"></script>
		<!-- Theme Base, Components and Settings -->
		<script src="../admin/js/theme.js"></script>
		<!-- Theme Custom -->
		<script src="../admin/js/theme.custom.js"></script>
		<!-- Theme Initialization Files -->
		<script src="../admin/js/theme.init.js"></script>
		<!-- Examples -->
		<script src="../admin/js/tables/examples.datatables.default.js"></script>
		<script src="../admin/js/tables/examples.datatables.row.with.details.js"></script>
		<script src="../admin/js/tables/examples.datatables.tabletools.js"></script>
		<script type="text/javascript">
		//修改
		function editmenu(){
			var id = ${id};
			var menuname = $("#menuname").val();
			var pid = $("#pid").val(); 
			var url = $("#url").val(); 
			$.get('../admin/editMenu?menuname='+menuname+'&id='+id+'&pid='+pid+'&url='+url,function(data){
				if(data=='suc'){
					location.href='../admin/menuView';
				}else if(data=='fal'){
					alert('添加失败!');
				}else if(data=='exist'){
					alert('该角色存在！');
				}
			});
		}
		</script>
	</body>

</html>